﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmGestionarProveedor.aspx.cs" Inherits="Presentacion.frmGestionarProveedor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Ingrese Nombre:"></asp:Label>
    <asp:TextBox ID="txtBusca" runat="server"></asp:TextBox>
    <asp:Button ID="btnBuscar" runat="server" Text="Buscar" Width="71px" />
    <asp:Button ID="btnNuevoProveedor" runat="server" 
        onclick="btnNuevoProveedor_Click" Text="Nuevo Proveedor" />

    <asp:GridView ID="GridView1" runat="server" 
    DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" Width="412px" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
            <asp:BoundField DataField="RazonSocial" HeaderText="RazonSocial" 
                SortExpression="RazonSocial" />
            <asp:BoundField DataField="Ruc" HeaderText="Ruc" SortExpression="Ruc" />
            <asp:BoundField DataField="Direccion" HeaderText="Direccion" 
                SortExpression="Direccion" />
            <asp:BoundField DataField="Telefono" HeaderText="Telefono" 
                SortExpression="Telefono" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />

            <asp:HyperLinkField DataNavigateUrlFields="Id" 
            DataNavigateUrlFormatString="frmProveedor.aspx?acc=editar&amp;Id={0}" 
            HeaderText="Accion" Text="Editar" />

            <asp:TemplateField HeaderText="Acciones">
                    <ItemTemplate>
                           <asp:LinkButton ID="LinkButton2" runat="server" 
                            PostBackUrl='<%# Eval("Id", "frmProveedor.aspx?acc=eliminar&Id={0}") %>'>Eliminar</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>

        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
    SelectMethod="BuscarProveedorPorNombre" TypeName="BL.ProveedorBL">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtBusca" DefaultValue="%" Name="nombre" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>